package string;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String line = "hel123lo12312worl123d";
        line = line.replaceAll("[0-9]+", "###");
        System.out.println(line);

        String regex = "(gun|sub|fuck|sha)";
        String message = "I love gun, sub, fuck, sha";
        message = message.replaceAll(regex, "***");
        System.out.println(message);
    }
}
